//winmain.cpp - mainly winning

#include "precompiled_header.h"
#include "win_system.h"
#include "console.h"

Win32vars win32;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    bool bQuit = false;
	win32.hInstance = hInstance;

	CreateDebugConsole(); 
	
	SystemInit();

	//Initialize everything else

	while(1)
	{
        //put this somewhere else in the future
        MSG msg;

        while(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
        {
            if(!GetMessage(&msg, NULL, 0, 0))
                bQuit = true; //total hack, plz fix
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
        if(bQuit == true)
            break;
	}

    ShutdownDebugConsole();

	return 0;
}